package com.aier.school.service;

import java.sql.Timestamp;
import java.util.List;
import java.util.Map;

import com.aier.school.entity.School;
import com.aier.school.entity.TeacherLeave;


public interface ISchoolLeaveService {

    /**
     * 根据教师名字排序
     */
    int TEACHER_SORTABLE_NAME=1;
    
    /**
     * 根据教师名字倒排序
     */
    int TEACHER_SORTABLE_NAME_DESC=2;
    
    /**
     * 根据账号排序
     */
    int TEACHER_SORTABLE_ACCOUNT=3;
    
    /**
     * 根据账号倒排序
     */
    int TEACHER_SORTABLE_ACCOUNT_DESC=4;
    
    /**
     * 根据开始时间排序
     */
    int TEACHER_SORTABLE_SDATE=5;
    
    /**
     * 根据开始时间倒排序
     */
    int TEACHER_SORTABLE_SDATE_DESC=6;
    
    /**
     * 根据结束时间排序
     */
    int TEACHER_SORTABLE_EDATE=7;
    
    /**
     * 根据结束时间倒排序
     */
    int TEACHER_SORTABLE_EDATE_DESC=8;
    
    

    /**
     * 根据条件查询所有的请假信息
     * @param page
     * @return
     */
    Map<String, Object> searchTerLeavesByCondition(int page,int pagesize, int sid,
            List<Long> tids,int type_handle, String txt_sdate, String txt_edate);

    List<TeacherLeave> searchTerLeavesByCondition( int sid,
            List<Long> tids,int type_handle, Integer year_begin, Integer month_begin,
            Integer year_end, Integer month_end);
    
    /**
     * 查询教师的请假信息
     * @param page
     * @param monthAttendListPagesize
     * @param sortable
     * @param tid
     * @return
     */
    Map<String, Object> searchTeacherLeavesByCondition(int page,
            int pagesize, int sortable, int tid);
    
    /**
     * 根据条件查询教师的异常处理的请假信息
     * @param page
     * @param monthAttendListPagesize
     * @param sortable
     * @param tid
     * @param txt_sdate
     * @param txt_edate
     * @return
     */
    Map<String, Object> searchTeacherLeavesByException(int page,
            int pagesize, int sortable, int tid,String txt_sdate, String txt_edate);
    /**
     * 添加教师请假信息
     * 
     */
    int insertTeacherLeave(Long tid, Timestamp sdate,Timestamp edate,int sid);
 
    /**
     * 添加教师请假信息
     * @param tid
     * @param sdate
     * @param edate
     * @param sid
     * @param desinfo
     * @param state
     * @param type_handle
     * @return
     */
    int insertTeacherLeave(Long tid, Timestamp sdate,Timestamp edate,Integer sid,String desinfo,short state,int type_handle);
    
    /**
     * 添加教师请假信息(补假)
     * @param tid_add
     * @param sdate
     * @param edate
     * @param sid
     * @param desinfo
     * @param state
     * @param type_handle;
     * @param tid
     * @return
     */
    int insertTeacherLeave(Long tid_add, Timestamp sdate,Timestamp edate,Integer sid,String desinfo,short state,int type_handle,long tid);

    /**
     * 根据请假id删除请假信息
     * 
     */
    int deleteTeacherLeave(Long lid);

    /**
     * 更新考勤表
     * @param tid
     * @param sdate
     * @param edate
     * @return
     */
    int updateTeacherAttendanceMonth(Long tid, Timestamp sdate, Timestamp edate);

    School searchSchoolByTid(int tid);

    /**
     * 修改请假的状态
     * @param longValue
     * @param state_leave
     * @param tid
     * @param desinfo_do
     * @return
     */
    int updateTeacherLeave(long longValue, short state_leave,long tid,String desinfo_do);

    /**
     * 批量添加请假信息
     * @param tids
     * @param sdate
     * @param edate
     * @param sid
     * @param txt_desinfo
     * @param state
     * @param type_handle
     * @param utid
     * @return
     */
    int insertTeacherLeaves(List<Long> tids, Timestamp sdate, Timestamp edate,
            int sid, String txt_desinfo, short state, Integer type_handle,long utid);

    /**
     * 根据考情id查询 异常的请假信息
     * @param page
     * @param teacherLeaveListPagesize
     * @param sortable
     * @param sid
     * @param long1
     * @param taid
     * @return
     */
    Map<String, Object> searchTerLeaves(int page, int teacherLeaveListPagesize,
            int sortable, int sid, Long uid, Integer taid);

    /**
     * 查询教师本人请假信息
     * @param tid
     * @return
     */
    List<TeacherLeave> searchTeacherLeavesByCondition(int tid);

    /**
     * 查询学校所有教师请假信息
     * @param sid
     * @param state_leave
     * @return
     */
    List<TeacherLeave> searchSchoolTeacherLeaves(long sid,Short state_leave);
    
}
